Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add access to applet for prolific respondent #572

Merged
merged 6 commits into from
Feb 27, 2025

Conversation

hamzace
Copy link
Contributor

@hamzace hamzace commented Jan 30, 2025

📝 Description

This PR adds the ability for a prolific recruit to submit their answer for an activity. So far for this to be working, the applet has to be configured with a public link, and needs to contain only one activity.

How it works: Prolific participant is redirected to mindlogger public link. The app parses the URL and searches for 3 parameters: PROLIFIC_PID, SESSION_ID & STUDY_ID.

At this point 3 checks are made:

  • (Frontend check) One of the parameter is missing => ERROR
  • (Backend check) The prolific integration is not configured in the backend => ERROR
  • (Backend check) The study_id is wrong => ERROR

If all checks passed: We store the parameters in redux and the user can take on the activity. If the user has already submitted their answer, they will be blocked and cannot take on the activity

On submission, we send the prolific parameters to the backend:

  • if the submission has been validated by the backend, we then make a query for the completion codes and redirect to prolific
  • if an error occurs in retrieving the completion code we show an error banner asking the participant to follow the NOCODE policy.
  • if the participant has already completed the activity/applet, an error occurs and we don't redirect the user.

🔗 Jira Ticket M2-8336
🔗 Jira Ticket M2-8337
🔗 Jira Ticket M2-8338

Changes include:

  • 2 new queries useProlificIntegrationStateQuery & useProlificCompletionCodeQuery and a ProlificService to request the backend
  • Added prolific params in store
  • A selector for prolific

🪤 Peer Testing

You need this PR in the backend to be running

✏️ Notes

  • Translations are generated using AI, please can you double check? (Especially for greek)

@hamzace hamzace requested review from farmerpaul and ChaconC January 30, 2025 17:56
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-572.d15zn9do8xbzga.amplifyapp.com

Copy link
Contributor

@ChaconC ChaconC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible for you to include or share via Slack the steps required to test correctly?
I'm getting an error state This assessment is no longer accepting respondents even though my applet, prolific study (incl funding), etc are all properly set up.

CleanShot 2025-02-10 at 09 29 14

@hamzace hamzace requested a review from ChaconC February 17, 2025 14:45
@hamzace hamzace changed the title feat: add access to prolific respondant feat: add access to applet for prolific respondent Feb 17, 2025
@hamzace hamzace merged commit 14f55b3 into dev Feb 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants